package com.example.harmonyos_orm.net;

import com.example.harmonyos_orm.data.Ip;
import com.zhushenwudi.hmutils.net.HttpBean;
import io.reactivex.Observable;
import okhttp3.RequestBody;
import retrofit2.http.*;

/**
 * 网络接口类
 */
public interface ApiService {
    String SERVER_URL = "http://apis.juhe.cn";

    @Headers({"Content-Type:application/x-www-form-urlencoded; charset=utf-8"})
    @GET("/ip/ipNew")
    Observable<HttpBean<Ip>> getIp(@Query("ip") String ip);

    @Headers({"Content-Type:application/json; charset=utf-8"})
    @POST("/ip/ipNew")
    Observable<HttpBean<Ip>> postIp(@Body RequestBody body);
}
